<?php
App::uses('AppModel', 'Model');
/**
 * Pais Model
 *
 */
class Pais extends GeonamesAppModel {

/**
 * Display field
 *
 * @var string
 */
	public $useDbConfig = 'geonames';
	public $displayField = 'countryName';
	public $useTable = 'geonames_paises';

	public function findCountryByGeoCode($code){
		$data = $this->find('first', array('conditions'=>array('geonameId'=>$code, 'language'=> getLanguage())));
		return $data[$this->alias]['countryName'];
	}

}
